/*
 * bsp_timer.h
 *
 * Copyright (C) 2011 - Dr.NP
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * @version bsp_timer.c 1.0.0
 * @package libbspcore
 * @author Dr.NP <np@bsgroup.org>
 * @update 03/21/2011
 */

#ifndef BSP_TIMER_H

#define BSP_TIMER_H                             1

#include <time.h>
#include <sys/epoll.h>
// Definations
#define TIMER_LIST_INITIAL                      256

// Macros

// Structs
struct timer_t
{
    int id;
    int fd;
    struct timespec interval;
    struct epoll_event ev;
    void (* cb) (int, void *);
    void *arg;
    u_int64_t loop;
	int worker_id;
};

// Functions
struct timer_t * get_timer(int);

#endif
